# Go parameters
GOCMD=GO111MODULE=on go
GOBUILD=$(GOCMD) build
GODOWNLOAD=$(GOCMD) mod download

download:
	$(GODOWNLOAD)

build:
	rm -rf target/
	mkdir target/
	cp cmd/prod/config-example.toml target/config.toml
	$(GOBUILD) -o target/prod cmd/prod/main.go

clean:
	rm -rf target/

dev:
	go run cmd/prod/main.go -c=cmd/prod/config-example.toml

run:
	nohup target/prod -c=target/config.toml  2>&1 > target/prod.log &

stop:
	pkill -f target/prod